package com.avicit.zipkinkafkaesserver.entity;

import com.avicit.zipkinkafkaesserver.utils.JsonUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 接口调用次数统计
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "ZIPKIN_INTERFACE_COUNT")
public class ZipkinInterfaceCount implements Serializable {

  @Id
  private String id;
  private String interfaceIp;
  private Integer serverPort;
  private String serverName;
  private String interfacePath;
  private String interfaceMethods;//请求方式
  private String interfaceStatus;
  /**
   * 接口调用的总次数
   */
  private Integer interfaceCount;

  //记录数据属于的哪天,方便查询
  private String queryDate;

  //抓取es 记录中的开始时间
  private Long esStartTime;
  //抓取es 记录中的结束时间
  private Long esEndTime;

  /**
   * 对应的 ok 次数
   */
  private Integer ok;
  /**
   *
   * error 次数
   */
  private Integer countError;


  @Temporal(TemporalType.TIMESTAMP)
  @CreationTimestamp
  private Date createTime;
  @Temporal(TemporalType.TIMESTAMP)
  @UpdateTimestamp
  private Date updateTime;

}
